#ifndef __WIZ_ACCESSOR_LITTLEENDIAN_HPP__SHANHAOBO_19800429__
#define __WIZ_ACCESSOR_LITTLEENDIAN_HPP__SHANHAOBO_19800429__

#include "./WizAccessorInner.hpp"

namespace Wiz
{
    namespace Accessor
    {
        namespace LittleEndian
        {
            struct WIZ_PRIVATE Type : public ::Wiz::Accessor::Base::Type
            {
                ::Wiz::Accessor::Ptr m_CorePtr;

                Type(::Wiz::Accessor::Ptr APtr) : m_CorePtr(APtr)
                {

                }

                //////////////////////////////////////////////////////////////////////////
            protected:
                template<class T>
                ::Wiz::Bool::Type InnerRead(T& OutData)
                {
                    T Temp;
                    if (m_CorePtr->Read(::Wiz::Cast::Static<::Wiz::Byte::OutPtr>(&Temp), sizeof(Temp)))
                    {
                        OutData = ::Wiz::Endian::FromLittleEndianToNative(Temp);
                        return ::Wiz::Bool::False;
                    }
                    return ::Wiz::Bool::True;
                }

                template<class T>
                ::Wiz::Bool::Type InnerWrite(T& InData)
                {
                    T Temp = ::Wiz::Endian::FromNativeToLittleEndian(InData);
                    return m_CorePtr->Write(::Wiz::Cast::Static<::Wiz::Byte::InPtr>(&Temp), sizeof(Temp));
                }
                template<class T>
                ::Wiz::Bool::Type InnerReadAndAdvance(T& OutData)
                {
                    T Temp;
                    if (m_CorePtr->ReadAndAdvance(::Wiz::Cast::Static<::Wiz::Byte::OutPtr>(&Temp), sizeof(Temp)))
                    {
                        OutData = ::Wiz::Endian::FromLittleEndianToNative(Temp);
                        return ::Wiz::Bool::True;
                    }
                    return ::Wiz::Bool::False;
                }

                template<class T>
                ::Wiz::Bool::Type InnerWriteAndAdvance(T& InData)
                {
                    T Temp = ::Wiz::Endian::FromNativeToLittleEndian(InData);
                    return m_CorePtr->WriteAndAdvance(::Wiz::Cast::Static<::Wiz::Byte::InPtr>(&Temp), sizeof(Temp));
                }
            public:

                virtual ::Wiz::Bool::Type Read(::Wiz::Byte::OutPtr BuffPtr, ::Wiz::Size::In ReadSize)
                {
                    return m_CorePtr->Read(BuffPtr, ReadSize);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Byte::InPtr DataPtr, ::Wiz::Size::In WriteSize)
                {
                    return m_CorePtr->Write(DataPtr, WriteSize);
                }

                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Byte::OutPtr BuffPtr, ::Wiz::Size::In ReadSize)
                {
                    return m_CorePtr->ReadAndAdvance(BuffPtr, ReadSize);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Byte::InPtr DataPtr, ::Wiz::Size::In WriteSize)
                {
                    return m_CorePtr->WriteAndAdvance(DataPtr, WriteSize);
                }

            public:
                //////////////////////////////////////////////////////////////////////////
                virtual ::Wiz::Bool::Type Read(::Wiz::Boolean8::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Boolean16::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Boolean32::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Boolean64::Out OutData)
                {
                    return this->InnerRead(OutData);
                }

                virtual ::Wiz::Bool::Type Read(::Wiz::Int8::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Int16::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Int32::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Int64::Out OutData)
                {
                    return this->InnerRead(OutData);
                }

                virtual ::Wiz::Bool::Type Read(::Wiz::UInt8::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::UInt16::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::UInt32::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::UInt64::Out OutData)
                {
                    return this->InnerRead(OutData);
                }

                virtual ::Wiz::Bool::Type Read(::Wiz::Real16::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Real32::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                virtual ::Wiz::Bool::Type Read(::Wiz::Real64::Out OutData)
                {
                    return this->InnerRead(OutData);
                }
                ///===================================///

                ///===================================///
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Boolean8::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Boolean16::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Boolean32::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Boolean64::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }

                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Int8::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Int16::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Int32::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Int64::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }

                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::UInt8::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::UInt16::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::UInt32::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::UInt64::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }

                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Real16::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Real32::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                virtual ::Wiz::Bool::Type ReadAndAdvance(::Wiz::Real64::Out OutData)
                {
                    return this->InnerReadAndAdvance(OutData);
                }
                ///===================================///

                ///===================================///
                virtual ::Wiz::Bool::Type Write(::Wiz::Boolean8::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Boolean16::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Boolean32::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Boolean64::In InData)
                {
                    return this->InnerWrite(InData);
                }

                virtual ::Wiz::Bool::Type Write(::Wiz::Int8::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Int16::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Int32::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Int64::In InData)
                {
                    return this->InnerWrite(InData);
                }

                virtual ::Wiz::Bool::Type Write(::Wiz::UInt8::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::UInt16::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::UInt32::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::UInt64::In InData)
                {
                    return this->InnerWrite(InData);
                }

                virtual ::Wiz::Bool::Type Write(::Wiz::Real16::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Real32::In InData)
                {
                    return this->InnerWrite(InData);
                }
                virtual ::Wiz::Bool::Type Write(::Wiz::Real64::In InData)
                {
                    return this->InnerWrite(InData);
                }
                ///===================================///

                ///===================================///
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Boolean8::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Boolean16::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Boolean32::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Boolean64::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }

                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Int8::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Int16::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Int32::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Int64::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }

                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::UInt8::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::UInt16::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::UInt32::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::UInt64::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }

                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Real16::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Real32::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                virtual ::Wiz::Bool::Type WriteAndAdvance(::Wiz::Real64::In InData)
                {
                    return this->InnerWriteAndAdvance(InData);
                }
                ///===================================///
            };
        } /// end of namespace LittleEndian
    } /// end of namespace Accessor
} /// end of namespace Wiz

#endif /*__WIZ_ACCESSOR_LITTLEENDIAN_HPP__SHANHAOBO_19800429__*/

